require 'migration_helpers'

class CreateTeachers < ActiveRecord::Migration
  extend MigrationHelper::ForeignKeys
  
  def self.up
    create_table :teachers do |t|
      t.column :address_id, :integer
      t.column :first_name, :string
      t.column :last_name, :string
      t.column :notes, :text
      t.column :email, :string
      t.column :active, :boolean, :default => true     
      t.column :created_at, :date
      t.column :updated_at, :date
    end
    
    add_foreign_key(:teachers, :address_id, :addresses)
  end

  def self.down
    drop_table :teachers
  end
end
